package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLLong;
import HLLib.base.HLString;

public class HLClassLong extends HLLibClass {
    public HLClassLong(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLLong();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLLong) self).SetLong((HLLong)args.GetObject(0));
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                ((HLLong) self).GetIntLow();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLLong) self).GetIntLow());
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLLong) self).GetIntHigh();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLLong) self).GetIntHigh());
            }
            break;
        }
        }
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLLong.Subtract((HLLong)args.GetObject(0), (HLLong)args.GetObject(1));
            } else {
                resultOwnerObject.SetInt(resultIndex, HLLong.Subtract((HLLong)args.GetObject(0), (HLLong)args.GetObject(1)));
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLLong.Parse((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLLong.Parse((HLString)args.GetObject(0)));
            }
            break;
        }
        }
    }
}
